package com.nacos.search.mapper;
import com.nacos.search.dto.DocBean;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.elasticsearch.annotations.Query;
import org.springframework.data.elasticsearch.repository.ElasticsearchRepository;
public interface ElasticRepository extends ElasticsearchRepository<DocBean, Long> {

  //默认的注释
  //@Query("{\"bool\" : {\"must\" : {\"field\" : {\"content\" : \"?\"}}}}")
  Page<DocBean> findByContent(String content, Pageable pageable);

  @Query("{\"bool\" : {\"must\" : {\"field\" : {\"firstCode.keyword\" : \"?\"}}}}")
  Page<DocBean> findByFirstCode(String firstCode, Pageable pageable);

  @Query("{\"bool\" : {\"must\" : {\"field\" : {\"secordCode.keyword\" : \"?\"}}}}")
  Page<DocBean> findBySecordCode(String secordCode, Pageable pageable);
}
